<template>
  <view class="natice">
    <NoticeItem
      v-for="item in list"
      :key="item.id"
      :item="item"
      @getData="() => getData()"
    ></NoticeItem>
  </view>
</template>

<script setup>
import { ref } from 'vue'
import NoticeItem from './NoticeItem.vue'
import { getNoticeList } from '@/services/message/notice'
import { onReady } from '@dcloudio/uni-app'

const list = ref()

const getData = () => {
  getNoticeList().then((res) => {
    list.value = res.data.result
  })
}

onReady(() => {
  getData()
})
</script>

<style lang="scss" scoped>
.natice {
  padding: 10px;
}
</style>
